package com.ruoyi.youtian.service.impl;

import com.ruoyi.youtian.domain.Dictionary;
import com.ruoyi.youtian.mapper.DictionaryMapper;
import com.ruoyi.youtian.service.IDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 字典Service业务层处理
 *
 * @author ruoyi
 * @date 2022-09-06
 */
@Service
public class DictionaryServiceImpl implements IDictionaryService {

    @Autowired
    private DictionaryMapper dictionaryMapper;

    /**
     * 查询字典
     *
     * @param dictionaryId 字典主键
     * @return 字典
     */
    @Override
    public Dictionary selectDictionaryByDictionaryId(Long dictionaryId)
    {
        return dictionaryMapper.selectDictionaryByDictionaryId(dictionaryId);
    }

    /**
     * 查询字典列表
     *
     * @param dictionary 字典
     * @return 字典
     */
    @Override
    public List<Dictionary> selectDictionaryList(Dictionary dictionary)
    {
        return dictionaryMapper.selectDictionaryList(dictionary);
    }

    /**
     * 新增字典
     *
     * @param dictionary 字典
     * @return 结果
     */
    @Override
    public int insertDictionary(Dictionary dictionary)
    {
        return dictionaryMapper.insertDictionary(dictionary);
    }

    /**
     * 修改字典
     *
     * @param dictionary 字典
     * @return 结果
     */
    @Override
    public int updateDictionary(Dictionary dictionary)
    {
        return dictionaryMapper.updateDictionary(dictionary);
    }

    /**
     * 批量删除字典
     *
     * @param dictionaryIds 需要删除的字典主键
     * @return 结果
     */
    @Override
    public int deleteDictionaryByDictionaryIds(Long[] dictionaryIds)
    {
        return dictionaryMapper.deleteDictionaryByDictionaryIds(dictionaryIds);
    }

    /**
     * 删除字典信息
     *
     * @param dictionaryId 字典主键
     * @return 结果
     */
    @Override
    public int deleteDictionaryByDictionaryId(Long dictionaryId)
    {
        return dictionaryMapper.deleteDictionaryByDictionaryId(dictionaryId);
    }
}
